package csce315.group10.androidapp;

import org.simpleframework.xml.Element;

import android.os.Parcel;
import android.os.Parcelable;



public class Message implements Parcelable{
	String text;
	String author;
	
	public Message(@Element(name = "text")String _text,@Element(name = "author")String _author){
		text = _text;
		author = _author;
	}
	/* constructor used by Parcelable */
	public Message(Parcel source){
        /*
         * Reconstruct from the Parcel
         */
        text = source.readString();
        author = source.readString();
  }
	/* used in serialization to pass in an intent */
	public int describeContents() {
		return hashCode();
	}
	/* used to serialize data to pass in an intent*/
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeString(text);
	    dest.writeString(author);

	}
	/* used to create an event object from Parcelable */
	public static final Parcelable.Creator CREATOR =
    	new Parcelable.Creator() {
            public Message createFromParcel(Parcel in) {
                return new Message(in);
            }
 
            public Message[] newArray(int size) {
                return new Message[size];
            }
        };
	
	@Element(name = "text")
	public String get_text(){
		return text;
	}
	
	@Element(name = "author")
	public String get_author(){
		return author;
	}
}